/* eslint valid-jsdoc: "off" */

'use strict';

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = exports = {};

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1595866938321_5472';

  // add your middleware config here
  config.middleware = ['authentication'];
  config.authentication = ['/api/login']
  // add your user config here
  config.security = {
    csrf: {
      enable: false
    },
    domainWhiteList: ['*']
  };
  config.cors = {
    origin: '*',
    allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH,OPTIONS'
  };
  const userConfig = {
    // myAppName: 'egg',
  };
  // 用户
  const user = {
  };
  config.jwt = {
    secret: 'egg',
  };
  config.mysql = {
    //database configuration 
    client: {
      //host 
      host: 'localhost',
      //port 
      port: '3307',
      //username 
      user: 'root',
      //password 
      password: 'a123456',
      //database 
      database: 'test'
    },
    //load into app,default is open //加载到应用程序，默认为打开
    app: true,
    //load into agent,default is close //加载到代理中，默认值为“关闭”
    agent: false,
  };
  return {
    ...config,
    ...userConfig,
  };
};
